fix(webhook): add dlq_dropped metric + warn on DLQ ring eviction (PILOT-313)#31
fix(webhook): add dlq_dropped metric + warn on DLQ ring eviction (PILOT-313)#31matthew-pilot wants to merge 1 commit into
Conversation
…OT-313) The dead-letter queue silently dropped the oldest entry when the 100-entry ring was full, with no metric or log to detect the loss. This adds: - atomic.Uint64 dlqDropped counter on the dispatcher - slog.Warn when an entry is evicted from the DLQ ring - dlq_dropped field in HandleGetWebhook response for monitoring - Test assertion verifying the counter after ring eviction Closes PILOT-313
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📊 PR Status — #31 PILOT-313
CI Checks (2/2 passing)
Canary🧪 Running — run #26706697221 (status: queued) Jira — PILOT-313Ticket claimed → fix implemented → PR opened. Awaiting canary results. Last Activity
|
🔍 PR Explanation — #31 PILOT-313What this doesAdds a The problem
The fix1. New
2. Warning log on eviction
3. Exposed in status endpoint
4. Test coverage
Impact
CI Checks (2/2 passing)
|
1 similar comment
🔍 PR Explanation — #31 PILOT-313What this doesAdds a The problem
The fix1. New
2. Warning log on eviction
3. Exposed in status endpoint
4. Test coverage
Impact
CI Checks (2/2 passing)
|
What
The webhook dead-letter queue silently dropped the oldest entry when its 100-entry ring buffer was full, with no metric or log to detect the data loss.
Root cause
addToDLQatwebhook/webhook.go:200-201usedd.dlqItems[1:]to evict the oldest entry without incrementing any counter or emitting a log line.Fix
dlqDropped atomic.Uint64field to the dispatcher structslog.Warnwhen an entry is evicted from the DLQ ringdlq_droppedin theHandleGetWebhookresponse alongside existingdelivered/failed/droppedstatsTestDispatcher_AddToDLQ_DropsOldestWhenFull)Verification
Files changed
2 files, +20 / -11
Closes PILOT-313